/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package BeansNegocio;

import Servicios.PersistenciaLocal;
import Servicios.PersistenciaRemote;
import java.util.List;
import javax.ejb.EntityContext;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;

/**
 *
 * @author usuario
 */
@Stateless
public class Persistencia implements PersistenciaRemote, PersistenciaLocal {


    @PersistenceContext
    private EntityManager manejador;


    public void insertar (Object o)
    {
       manejador.persist(o);
    }

    public List encontrarTodos (String consulta)
    {
      
        return manejador.createNamedQuery("get"+consulta).getResultList();
    }

    public Object encotrarPorId (Class c, Object id)
    {
       return null;

    }




    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")

}
